package com.eastfair.config.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 开关类
 * Date:2021/8/5
 * Time:16:41
 *
 * @author zjn
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class Switch {

    /**
     * 校验标识 获取单个开关
     */
    public interface VerifyGetByEntity {
    }
    public interface VerifyUpdateByEntity {
    }

    /**
     * 标识id
     */
    @NotNull(groups = {VerifyUpdateByEntity.class})
    @JsonFormat(shape= JsonFormat.Shape.STRING)
    private Long flagId;

    /**
     * 开关名称
     */
    private String name;

    /**
     * 开关关键字
     */
    @NotBlank(groups = {VerifyGetByEntity.class})
    private String keyword;

    /**
     * 开关使用主体
     */
    @NotBlank(groups = {VerifyGetByEntity.class})
    private String subjectType;

    /**
     * 开关语言环境
     */
    @NotBlank(groups = {VerifyGetByEntity.class})
    private String languageType;

    /**
     * 开关状态
     */
    @NotNull(groups = {VerifyUpdateByEntity.class})
    private Integer status;

}
